<template>
  <div class="pop-dialog-container">
    <div class="pop-dialog-main">
      <el-form label-position="right" :model="educationForm" :label-width="formLabelWidth" disabled="disabled">
        <el-row>
          <el-col :span="11">
            <el-form-item label="员工姓名">
              <el-input v-model="educationForm.employeeName"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="学校名称">
              <el-input v-model="educationForm.schoolName"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="11">
            <el-form-item label="学历">
              <el-select v-model="educationForm.degree" placeholder="请选择学历">
                <el-option label="初中" :value="10"></el-option>
                <el-option label="高中" :value="20"></el-option>
                <el-option label="本科" :value="30"></el-option>
                <el-option label="硕士研究生" :value="40"></el-option>
                <el-option label="博士研究生" :value="50"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="开始日期">
              <el-input v-model="educationForm.startDate"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="11">
            <el-form-item label="结束日期">
              <el-input v-model="educationForm.endDate"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="11">
            <el-form-item label="创建时间">
              <el-input v-model="educationForm.createTime"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="11">
            <el-form-item label="最后修改时间">
              <el-input v-model="educationForm.modifyTime"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <div class="pop-dialog-footer">
      <el-row>
        <el-col :span="12" :offset="6">
          <div class="form-button-container">
            <el-button @click="onBack" type="primary">关闭</el-button>
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
import educationApi from '@/api/educationApi'
export default {
  name: 'EducationView',
  props: ['id'],
  mixins: [
  ],
  data () {
    return {
      educationForm: {
      }
    }
  },
  created () {
    if (this.id) {
      educationApi.findById(this.id)
          .then(resp => {
            if (resp && resp.code === 1) {
              this.educationForm = resp.data
            } else {
              this.$message.error('获取数据失败')
            }
          })
          .catch(error => {
            console.error('获取数据失败:', error)
          })
    }
  },
  methods: {
    onBack () {
      this.$emit('close-education-view-event')
    }
  }
}
</script>

<style lang="scss">
</style>